<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>字典数据信息</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <%@include file="/WEB-INF/pages/common/common.jsp" %>
    <script type="text/javascript" src="${basePath}/js/ecommerce.js"></script>
    <script type="text/javascript" src="${basePath}/plugins/syntaxhighlighter/scripts/shCore.js"></script>
    <script class="javascript" src="${basePath}/plugins/syntaxhighlighter/scripts/shBrushJava.js"></script>
    <link type="text/css" rel="stylesheet" href="${basePath}/plugins/syntaxhighlighter/styles/shCoreDefault.css"/>
    <style>

        .table3 tr {
            height: 40px;
            line-height: 40px;
            border: 1px #ccc solid
        }

        .table3 input {
            width: 80%;
        }
    </style>
</head>
<body>
<div class="content content_frame">

    <h3 class="mainTitle"><img src="${basePath}/images/icon2.png"/>字典数据信息</h3>
    <br/>
    <ul class="contentNav dib-wrap">
        <c:if test="${false==modify}">
            <li class="dib" id="btnSave">
                <a onclick="javascript:save()">
                    <i class='fa fa-save'></i>&nbsp;&nbsp;保&nbsp;存 </a>
            </li>
        </c:if>
        <li class="dib">
            <a onclick="javascript:history.go(-1)">
                <i class='fa fa-reply'></i>&nbsp;&nbsp;返&nbsp;回 </a>
        </li>
    </ul>
    <form id="detailForm">
        <input type="hidden" name="indx"
               value="${baseDict.indx}">
        <input type="hidden" name="tableName" value="${dictManager.tableName}">
        <table class="table3">
            <tr>
                <th colspan="8">字典数据信息</th>
            </tr>
            <tr>
                <td width="300">
                    <c:choose>
                        <c:when test="${! empty dictManager.codeName}">
                            ${dictManager.codeName}
                        </c:when>
                        <c:otherwise>
                            字典编码
                        </c:otherwise>
                    </c:choose>
                </td>
                <td>
                    <input name="code" value="${baseDict.code}"/>
                </td>
            </tr>
            <tr>
                <td width="300"><c:choose>
                    <c:when test="${! empty dictManager.cnNameName}">
                        ${dictManager.cnNameName}
                    </c:when>
                    <c:otherwise>
                        中文名称
                    </c:otherwise>
                </c:choose></td>

                <td>
                    <input name="cnName" id="cnName" value="${baseDict.cnName}"/>
                </td>
            </tr>
            <c:if test="${! empty dictManager.enNameKey}">
                <tr>
                    <td width="300"><c:choose>
                        <c:when test="${! empty dictManager.enNameName}">
                            ${dictManager.enNameName}
                        </c:when>
                        <c:otherwise>
                            英文名称
                        </c:otherwise>
                    </c:choose></td>
                    <td>
                        <input name="enName" id="enName" value="${baseDict.enName}"/>
                    </td>
                </tr>
            </c:if>
            <c:if test="${! empty dictManager.remarkKey}">
                <tr>
                    <td width="120"><c:choose>
                        <c:when test="${! empty dictManager.remarkName}">
                            ${dictManager.remarkName}
                        </c:when>
                        <c:otherwise>
                            备注
                        </c:otherwise>
                    </c:choose></td>
                    <td>
                        <input name="remark" id="remark" value="${baseDict.remark}"/>
                    </td>
                </tr>
            </c:if>
        </table>
    </form>
</div>
<script type="text/javascript">
    function save() {
        $.ajax({
            type: "post",
            async: false,
            url: $basePath + "/baseDict/saveDictContentDetail",
            data: form2Json("detailForm"),
            success: function (result) {
                if (result) {
                    if ("success" == result) {
                        showOKMessage('保存成功!', '', function () {
                        });
                    } else {
                        ShowMessages(result, "系统提示", "msgwaring", null, 0);
                    }
                } else {
                    ShowMessages("保存失败", "系统提示", "msgwaring", null, 0);
                }
            }
        });
    }
    $(function () {
        $("#detailForm input,textarea,select,#btnSave").attr("disabled", ${modify});
    });
</script>
</body>
</html>
